﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Windows.Controls;
using System.Globalization;
using System.Windows.Media;

namespace MyPublisher.Windows.Theme
{
    public class TooltipConverter : IValueConverter
    {
        private static TooltipConverter _instance;

        public static TooltipConverter Instance
        {
            get
            {
                if (_instance == null)
                    _instance = new TooltipConverter();
                return _instance;
            }
        }

        #region IValueConverter Members

        object IValueConverter.Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value is TextBlock)
            {
                return ((TextBlock)value).Text;
            }
            return value == null ? null : value.ToString();
        }

        object IValueConverter.ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
